#include <iostream>
#include <unistd.h>

using namespace std;

class HeapOnly{
	private:
		HeapOnly()
		{}
		~HeapOnly()
		{}	
	public:
		int m;
	public:
		static HeapOnly* CreateInstance()
		{
			HeapOnly* obj = new HeapOnly;
			obj->m = 2;
			return obj;
		}

		static void DestroyInstance(HeapOnly* obj)
		{
			if(obj) {
				delete obj;
			}
		}
};

int main()
{
	HeapOnly* obj = HeapOnly::CreateInstance();
	cout << obj->m << endl;
	HeapOnly::DestroyInstance(obj);
	return 0;
}
